﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using SharpShare.Storage;
using SharpShare.Collections;

namespace SharpShare.Configuration {
    public sealed class StoragePathTypeConverter : TypeConverter {
        public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) {
            return (sourceType == typeof(string));
        }
        public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) {
            if (value is string) {
                return Path.Parse(value.ToString());
            }

            return base.ConvertFrom(context, culture, value);
        }
    }
}
